cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 11)
#set(NDK /Users/xxx/Library/Android/sdk/ndk/22.0.7026061)
#arm64-v8a armeabi-v7a
# set(ANDROID_ABI armeabi-v7a)
#Debug Release
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_TOOLCHAIN_FILE ${NDK}/build/cmake/android.toolchain.cmake)
project (local_caller)

enable_language(ASM)

if (${CMAKE_ANDROID_ARCH_ABI} STREQUAL "arm64-v8a")
        set(MY_OUT_NAME native_hook64)
        file(GLOB native_hook_asm_src
                "route_func/asm64/*.asm")
else ()
        set(MY_OUT_NAME native_hook)
        file(GLOB native_hook_asm_src
                "route_func/asm/*.asm")
endif ()

aux_source_directory(./dlfc dlfc)
aux_source_directory(./hook_jni hook_jni)
aux_source_directory(./json myjson)
aux_source_directory(./route_func route_func)
aux_source_directory(./utils utils)

add_subdirectory(dobby)

add_library(
        ${MY_OUT_NAME}
        SHARED
        ${native_hook_asm_src} ${myjson} ${dlfc} ${hook_jni} ${route_func} ${utils})

find_library(log-lib log)

target_link_libraries(${MY_OUT_NAME}
        dobby
        ${log-lib})
